package com.melodyframe.common.tools.convert;

public class IntegerConverter extends AbstractConverter<Integer> {

	@Override
	public Class<?>[] getSupports() {
		return new Class<?>[] { int.class, Integer.class };
	}

	@Override
	public Integer convert(Object object, Class<?> classType, String format) {
		if (object instanceof Number) {
			return new Integer(((Number) object).intValue());
		} else {
			return new Integer(object.toString());
		}
	}
}
